<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/12
 * Time: 17:31
 */

namespace app\service;


use app\Func\RedisFunc;
use think\Config;
use Web3\Contract;

class BaseServcice
{
    protected $ldAddress;
    protected $ldAbi;
    protected $peer;
    protected $contract;

    protected $redis;

    public function __construct()
    {
        $config = Config::load(APP_PATH . '../config/solidity.php');
        $this->ldAddress = $config['ld_address'];
        $this->ldAbi = $config['ld_abi'];
        $this->peer = $config['peer'];
        $obj = new Contract($this->peer, $this->ldAbi);
        $this->contract = $obj->at($this->ldAddress);

        $this->redis = new RedisFunc();

    }
}